home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / DEMON / RISCOS2 / TCP_131S.ARC / h / telnet < prev    next >
Text File  |  1994-01-02  |  2KB  |  55 lines

  1. #include "Terminal.h"
  2.  
  3. #define LINESIZE        256     /* Length of local editing buffer */
  4.  
  5.  
  6. /* Telnet command characters */
  7. #define IAC             255     /* Interpret as command */
  8. #define WILL            251
  9. #define WONT            252
  10. #define DO              253
  11. #define DONT            254
  12.  
  13. /* Telnet options */
  14. #define TN_TRANSMIT_BINARY      0
  15. #define TN_ECHO                 1
  16. #define TN_SUPPRESS_GA          3
  17. #define TN_STATUS               5
  18. #define TN_TIMING_MARK          6
  19. #define NOPTIONS                6
  20.  
  21. /* Telnet protocol control block */
  22. struct telnet {
  23.         struct tcb *tcb;
  24.         char state;
  25.  
  26. #define TS_DATA 0       /* Normal data state */
  27. #define TS_IAC  1       /* Received IAC */
  28. #define TS_WILL 2       /* Received IAC-WILL */
  29. #define TS_WONT 3       /* Received IAC-WONT */
  30. #define TS_DO   4       /* Received IAC-DO */
  31. #define TS_DONT 5       /* Received IAC-DONT */
  32.  
  33.         char local[NOPTIONS];   /* Local option settings */
  34.         char remote[NOPTIONS];  /* Remote option settings */
  35.  
  36.         struct session *session;        /* Pointer to session structure */
  37.         Terminal *window;
  38. };
  39. #define NULLTN  (struct telnet *)0
  40.  
  41. extern int refuse_echo;
  42.  
  43. /* In TELNET */
  44. int dotelnet(int, char **);
  45. void unix_send_tel(struct session *, char *, int16);
  46. void send_tel(struct session *, char *, int16);
  47. void tel_input(struct telnet *, struct mbuf *);
  48. void rcv_char(struct tcb *, int16);
  49. void tn_tx(struct tcb *, int16);
  50. void t_state(struct tcb *, char, char);
  51.  
  52. /* In TNSERV */
  53. int tn1(int, char **);
  54. int tn0(void);
  55.